package com.tian.repository;

import com.tian.po.UserPO;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface UserRepository extends JpaRepository<UserPO, Long> {
    List<UserPO> findByName(String name);

    UserPO findByNameAndAge(String name, int age);

    @Query("from UserPO u where u.name=:name")
    List<UserPO> findUser(@Param("name") String name);
}
